<template>
  <MTable
    :data="tableData"
    :columns="getColumns"
    :scroll="{ x: 1500 }"
    :onChange="onPageChange"
    row-key="key"
    :pagination="pagination"
    :loading="loading"
    wrapperStyle="width: 600px"
  >
    <span slot="customTitle"><Icon type="smile-o" /> 测试a</span>
    <span slot="a" slot-scope="{ text }">{{ text + "1111" }}</span>
    <span slot="action" slot-scope="{ record }">
      <Button @click="operate(record)">编辑</Button>
    </span>
  </MTable>
</template>

<script>
import MTable from "@/components/MTable/index";
import { Button, Icon } from "ant-design-vue";
import columns from "./columns";
import tableData from "./tableData";

export default {
  name: "demo-table",
  components: { Button, Icon, MTable },
  data() {
    return {
      isM: false,
      tableData: tableData,
      loading: false,
      pagination: { pageSize: 15, current: 1 },
    };
  },
  methods: {
    operate(a) {
      console.log(a);
    },
    onPageChange() {},
  },
  computed: {
    getColumns() {
      return columns({ isM: this.isM });
    },
  },
};
</script>

<style scoped lang="less"></style>
